^
1

Details — A single action in detail.
About the action rulebooks  


Standard actions which change the state of things
Locking it with , Unlocking it with , Switching on , Switching off , Opening , Closing , Wearing , Taking off 


Locking something with something (past tense locked it with)

Locking is the act of using an object such as a key to ensure that something such as a door or container cannot be opened unless first unlocked. (Only closed things can be locked.)

Locking can be performed on any kind of thing which provides the either/or properties lockable, locked, openable and open. The 'can't lock without a lock rule' tests to see if the noun both provides the lockable property, and if it is in fact lockable: it is then assumed that the other properties can safely be checked. In the Standard Rules, the container and door kinds both satisfy these requirements.

We can create a new kind on which opening, closing, locking and unlocking will work thus: 'A briefcase is a kind of thing. A briefcase can be openable. A briefcase can be open. A briefcase can be lockable. A briefcase can be locked. A briefcase is usually openable, lockable, open and unlocked.'

Inform checks whether the key fits using the 'can't lock without the correct key rule'. To satisfy this, the actor must be directly holding the second noun, and it must be the current value of the 'matching key' property for the noun. (This property is seldom referred to directly because it is automatically set by assertions like 'The silver key unlocks the wicket gate.')

The Standard Rules provide locking and unlocking actions at a fairly basic level: they can be much enhanced using the extension Locksmith by Emily Short, which is included with all distributions of Inform.


Typed commands leading to this action

"lock [something] with [something preferably held]"

Rules controlling this action

check    an actor locking something with  can't lock without a lock rule   name  unlist   1

check    an actor locking something with  can't lock what's already locked rule   name  unlist   1

check    an actor locking something with  can't lock what's open rule   name  unlist   1

check    an actor locking something with  can't lock without the correct key rule   name  unlist   1


carry out    an actor locking something with  standard locking rule   name  unlist


report    an actor locking something with  standard report locking rule   name  unlist   2


Click on the speech-bubble icons to see the responses, or here to see all of them:  6